package com.ruoyi.material.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.material.mapper.MaterialUseRequestMapper;
import com.ruoyi.material.domain.MaterialUseRequest;
import com.ruoyi.material.service.IMaterialUseRequestService;
import com.ruoyi.common.core.text.Convert;

/**
 * 焊材领用管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-11
 */
@Service
public class MaterialUseRequestServiceImpl implements IMaterialUseRequestService 
{
    @Autowired
    private MaterialUseRequestMapper materialUseRequestMapper;

    /**
     * 查询焊材领用管理
     * 
     * @param id 焊材领用管理主键
     * @return 焊材领用管理
     */
    @Override
    public MaterialUseRequest selectMaterialUseRequestById(Long id)
    {
        return materialUseRequestMapper.selectMaterialUseRequestById(id);
    }

    /**
     * 查询焊材领用管理列表
     * 
     * @param materialUseRequest 焊材领用管理
     * @return 焊材领用管理
     */
    @Override
    public List<MaterialUseRequest> selectMaterialUseRequestList(MaterialUseRequest materialUseRequest)
    {
        return materialUseRequestMapper.selectMaterialUseRequestList(materialUseRequest);
    }

    /**
     * 新增焊材领用管理
     * 
     * @param materialUseRequest 焊材领用管理
     * @return 结果
     */
    @Override
    public int insertMaterialUseRequest(MaterialUseRequest materialUseRequest)
    {
        materialUseRequest.setCreateTime(DateUtils.getNowDate());
        return materialUseRequestMapper.insertMaterialUseRequest(materialUseRequest);
    }

    /**
     * 修改焊材领用管理
     * 
     * @param materialUseRequest 焊材领用管理
     * @return 结果
     */
    @Override
    public int updateMaterialUseRequest(MaterialUseRequest materialUseRequest)
    {
        materialUseRequest.setUpdateTime(DateUtils.getNowDate());
        return materialUseRequestMapper.updateMaterialUseRequest(materialUseRequest);
    }

    /**
     * 批量删除焊材领用管理
     * 
     * @param ids 需要删除的焊材领用管理主键
     * @return 结果
     */
    @Override
    public int deleteMaterialUseRequestByIds(String ids)
    {
        return materialUseRequestMapper.deleteMaterialUseRequestByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除焊材领用管理信息
     * 
     * @param id 焊材领用管理主键
     * @return 结果
     */
    @Override
    public int deleteMaterialUseRequestById(Long id)
    {
        return materialUseRequestMapper.deleteMaterialUseRequestById(id);
    }
}
